
NL	("\n"|"\r\n")

%%

(a|{NL})* {
	int i;

	fputs("match: ", stdout);
	for (i = 0; i < yyleng; i++) {
		if (!isalnum(yytext[i])) {
			if (yytext[i] == '\n')
				fputs("'NL'", stdout);
			else if (yytext[i] == '\r')
				fputs("'CR'", stdout);
			else
				fputs("'UNKN'", stdout);
		} else {
			printf("'%c'", yytext[i]);
		}

		if (i + 1 < yyleng)
			fputs(", ", stdout);
	}
	fputc('\n', stdout);
}

b+ {
	printf("matched (2): %s\n", yytext);
}

. {}

%%

int yywrap(void) { return 1; }
int main(int argc, char **argv) { yylex(); return 0; }
